function saveAuthInfo() {
    Logger.log("saveAuthInfo");
    var usrInfo = document.getElementById("username");
    var usrPass = document.getElementById("userpass");
    
    var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"].getService(Components.interfaces.nsIPasswordManager);
//     Logger.log("saveAuthInfo: passwordManager obtained");
    passwordManager.addUser('http://www.moodmill.com', usrInfo.value , usrPass.value);
    
    //Logger.log("saveAuthInfo about to return already-upgraded-to-new-version");
}

function populateOptions() {
    var usrInfo = document.getElementById("username");
    var usrPass = document.getElementById("userpass");
    
    var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"].getService(Components.interfaces.nsIPasswordManager);
    // the host name of the password we are looking for
    var queryString = 'http://www.moodmill.com';
    // ask the password manager for an enumerator:
    var e = passwordManager.enumerator;
    // step through each password in the password manager until we find the one we want:
    while (e.hasMoreElements()) {
        try {
            // get an nsIPassword object out of the password manager.
            // This contains the actual password...
            var pass = e.getNext().QueryInterface(Components.interfaces.nsIPassword);
            if (pass.host == queryString) {
                // found it!]
                usrInfo.value = pass.user;
                usrPass.value = pass.password;
//                 alert(pass.user); // the username
//                 alert(pass.password); // the password
                break;
            }
        } catch (ex) {
            // do something if decrypting the password failed--probably a continue
        }
    }

}